/*
 * Licensed to the Deppon EXPRESS .
 */
package com.depponframework.rocketmq.spring.core;

import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeOrderlyStatus;
import org.apache.rocketmq.common.message.MessageExt;

import java.util.List;

public interface RocketListener {

    default ConsumeConcurrentlyStatus consumeMessage(final List<MessageExt> msgs, final ConsumeConcurrentlyContext context) {
        return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
    }

    default void resultHandler(ConsumeConcurrentlyStatus status) {
    }

    default ConsumeOrderlyStatus consumeMessage(final List<MessageExt> msgs, final ConsumeOrderlyContext context) {
        return ConsumeOrderlyStatus.SUCCESS;
    }

    default void resultHandler(ConsumeOrderlyStatus status) {
    }

}
